package com.es.set;

import com.es.bst.AbstractBinarySearchTree;
import com.es.tmp.Bst;

/**
 * @author 二十
 * @since 2022/1/17 8:04 下午
 */
public class TreeSet<E extends Comparable<E>> extends AbstractSet<E> {

    private AbstractBinarySearchTree<E> tree = new Bst<>();

    @Override
    public void add(E e) {
        tree.add(e);
    }

    @Override
    public void remove(E e) {
        tree.remove(e);
    }

    @Override
    public boolean contains(E e) {
        return tree.contains(e);
    }

    @Override
    public int getSize() {
        return tree.getSize();
    }

    @Override
    public boolean isEmpty() {
        return tree.isEmpty();
    }
}
